package com.Cfeng.XiaohuanChat.service.impl;

import com.Cfeng.XiaohuanChat.entity.ChatUserAuthority;
import com.Cfeng.XiaohuanChat.repository.ChatAuthorityRepository;
import com.Cfeng.XiaohuanChat.service.ChatAuthorityService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author Cfeng
 * @date 2022/8/7
 */

@Service
@RequiredArgsConstructor
public class ChatAuthorityServiceImpl implements ChatAuthorityService {

    private final ChatAuthorityRepository authorityRepository;

    @Override
    public ChatUserAuthority addAuthority(ChatUserAuthority chatUserAuthority) {
        return authorityRepository.save(chatUserAuthority);
    }

    @Override
    public void removeAuthority(ChatUserAuthority chatUserAuthority) {
        authorityRepository.delete(chatUserAuthority);
    }
}
